const cloud=tt.createCloud({
    envID:'env-T1eGkgnjgt',
    serviceID:'1k0chtz6upfdb'
});
function request(api,body,method){
    return new Promise((resolve,reject)=>{
        cloud.callContainer({
            path:api,
            init:{
                method:method,
                header:{
                    'content-type': 'application/json',
                },
                body:body,
                timeout: 60000,//ms
            },
            success:({statusCode, header, data})=>{
                JSON.parse(data)
                return resolve(JSON.parse(data))
            },
            fail: ()=>{
                console.warn
                return reject(console.warn)
            },
            complete: console.warn,
        })
    })
   
}
